import { notification } from "antd";

notification.config({
  duration: 60,
});

const successNotification = () => {
  notification.success({
    message: '修改成功',
    style: {
      fontWeight: "bold"
    }
  });
};


const failNotification = () => {
  notification.error({
    message: '修改失败',
    style: {
      fontWeight: "bold"
    }
  });
};

const failToGetDataNotification = () => {
  notification.error({
    message: '获取开发板数据失败',
    style: {
      fontWeight: "bold"
    }
  });
};

const uploadSuccessNotification = () => {
  notification.success({
    message: '固件更新成功，将重启设备，稍后可刷新页面！',
    style: {
      fontWeight: "bold"
    }
  });
};


const uploadWarningNotification = () => {
  notification.warning({
    message: '请先保证车道机程序已经运行再上传固件！',
    style: {
      fontWeight: "bold"
    }
  });
};

const uploadFailNotification = () => {
  notification.warning({
    message: '固件不可用，请重新上传固件！',
    style: {
      fontWeight: "bold"
    }
  });
};

const timAlreadyLoadedNotification = () => {
  notification.success({
    message: 'Tim已在后台',
    style: {
      fontWeight: "bold"
    },
    duration: 5
  });
};

const timNoAlreadyLoadedNotification = () => {
  notification.warning({
    message: 'Tim不在后台',
    style: {
      fontWeight: "bold"
    },
    duration: 5
  });
};

const timStartLoadedNotification = () => {
  notification.success({
    message: 'Tim执行命令成功（需要验证）',
    style: {
      fontWeight: "bold"
    },
    duration: 5
  });
};

const timStartLoadedFailedNotification = () => {
  notification.error({
    message: 'Tim执行失败',
    style: {
      fontWeight: "bold"
    },
    duration: 5
  });
};


export {
  successNotification,
  failNotification,
  failToGetDataNotification,
  uploadSuccessNotification,
  uploadFailNotification,
  uploadWarningNotification,
  timAlreadyLoadedNotification,
  timNoAlreadyLoadedNotification,
  timStartLoadedNotification,
  timStartLoadedFailedNotification
}